<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /*======= after伪元素必须添加的东西 =======*/
        .clearfix::before,
        .clearfix:after{
            content:"";
            display:table;
        }

        .clearfix:after{
            clear:both;
        }

        .clearfix{
            /*兼容IE6、7*/
            *zoom: 1;
        }

        /* ========================================= */

        .box{
            overflow: auto;
            background-color:skyblue;
            width:60%;
            height: 300px;
        }
        .innerbox{
            background-color:pink;
            width:20%;
            height: 50px;
            margin: 1px;
            float:left;
        }
        .footer{
            background-color:pink;
            width:20%;
            height: 50px;
        }

    </style>
</head>
<body>
    <div class = "box">
        <div class = "clearfix">
            <div class = "innerbox"></div>
            <div class = "innerbox"></div>
        </div>
        <div class = "footer"></div>
    </div>
</body>
</html>